import {
  enumsAll
} from '@/api/system';

const mutations = {
  SET_ENUM_MAP: (state, enums) => {
    state.enums = enums;
  },
}
const actions = {
  generateEnumMap({
    commit
  }) {
    return new Promise((resolve, reject) => {
      enumsAll('/all', 'post').then((response) => {
        const {
          data
        } = response;
        commit('SET_ENUM_MAP', data);
        resolve(data)
      }).catch(error => {
        reject(error)
      })
    })
  },
}
export default {
  namespaced: true,
  mutations,
  actions
}
